﻿@model MvcCmsOptIn.Models.OptInModel
@section HtmlHead{
    <link href="@Url.Content("/RazorThemes/" + Model._Portal.SkinName + "/css/optin.css")" rel="stylesheet" type="text/css" />
}
<div class="contentpage-outerdiv">
    <div id="container">
        <div class="breadcrumb">
            <span><a href="/optin-manager">Main Menu</a></span><span>» </span><span><a href="/optin-manager/links/@Model._TrackingLink.NewsLetterID">
                Tracking Links</a></span><span>» </span><span>Edit</span>
        </div>
        <div style="color: Red;">@ViewBag.Message &nbsp;</div>
        <div id="content">
            <h2>
                Edit Tracking Link</h2>
            <div>
            <form id="form1" action="" method="post">
            <table cellspacing="0" border="0" style="border-collapse: collapse;">
                <tbody>
                    <tr>
                        <td>
                            <table width="600" cellspacing="0" cellpadding="5" border="0" class="frame">
                                <tbody>
                                    <tr>
                                        <td colspan="2" class="toolbar">
                                            <a href="javascript:void(0);" onclick="SaveLink();">
                                                <img border="0" src="/areas/mvccmsoptin/content/buttons/save.gif" id="update" name="update">
                                            </a>
                                            <a href="javascript:void(0);" onclick="DeleteLink();">
                                                <img border="0" src="/areas/mvccmsoptin/content/buttons/delete.gif" id="delete" name="delete">
                                            </a>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <dl>
                                <dt>Name </dt>
                                <dd>
                                    <input type="text" style="width: 90%;" class="required" id="Name" value="@Model._TrackingLink.Name" name="Name" />
                                </dd>
                                <dt>URL </dt>
                                <dd>
                                    <input type="text" style="width: 90%;" class="required" id="URL" value="@Model._TrackingLink.URL" name="URL" />
                                </dd>
                                <dt>Date Created</dt>
                                <dd>
                                    @Model._TrackingLink.CreateDate by @Model._TrackingLink.Admin.UserName
                                </dd>
                            </dl>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div>
                Clicks
            </div>
            <div>
                @Model._TrackingLink.Clicks
            </div>
            @Html.Hidden("LinkTrackingID", Model._TrackingLink.LinkTrackingID)
            </form>
            </div>
        </div>
    </div>
</div>
@section ScriptContent{
    <script src="@Url.Content("/areas/mvccmsoptin/Scripts/jquery.validate.js")" type="text/javascript"></script>
    <script type="text/javascript">
        function SaveLink() {
            $("#form1").submit();
        }
        function DeleteLink() {
            $("#form1").attr("action", "/optin-manager/deletelink");
            $("#form1").submit();
        }
        $("#form1").validate();
    </script>
}
